<template>
  <div class="container">
    <button @click="testToast(1)">打开Toast</button>
    <button @click="testToast(2)">关闭Toast</button>
    <div>
      <SvgIcon name="test" class="test"></SvgIcon>
      <WzChart width="1000px" height="500px" :options="options"></WzChart>
      <button @click="handleChange">改变</button>
    </div>
  </div>
</template>

<script>
import MToast from '@/components/MToast'
import { configInfo } from '@/api'
import WzChart from '@/components/WzChart.vue'
export default {
  data() {
    return {
      options: {
        xAxis: {
          type: 'category',
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: [150, 230, 224, 218, 135, 147, 260],
            type: 'line'
          }
        ]
      }
    }
  },
  mounted() {
    // 测试接口
    configInfo()
  },
  components: {
    WzChart
  },
  methods: {
    testToast(type) {
      if (type === 1) {
        this.$showToast('显示')
      } else {
        this.$hideToast()
      }

    },
    handleChange() {
      this.options.series[0].data = [1, 2, 3, 4, 5, 6, 7]
    }
  }
}
</script>

<style lang="scss" scoped>
.container {
  display: flex;
  flex-direction: column;

  .test {
    font-size: 50px;
    color: green;
  }
}

</style>
